import {changePassWord, teacherHeadImg, parentHeadImg} from '@/api/personInfoApi'
const personInfo = {
    namespaced: true,
    state: {
        roleList: []
    },
    getters: {
      
    },
    mutations: { 
    },
    actions: { 
        // 修改密码
        ChangePassWord ({ state, commit, dispatch }, params) {
            return new Promise((resolve, reject) => {
                changePassWord(params).then(res => {
                    resolve(res)
                }).catch(
                    res => {
                        reject(res)
                    }
                )
            })
        },
        // 修改老师头像
        TeacherHeadImg ({ state, commit, dispatch }, params) {
            return new Promise((resolve, reject) => {
                teacherHeadImg(params).then(res => {
                    resolve(res)
                }).catch(
                    res => {
                        reject(res)
                    }
                )
            })
        },
        // 修改家长头像
        ParentHeadImg ({ state, commit, dispatch }, params) {
            return new Promise((resolve, reject) => {
                parentHeadImg(params).then(res => {
                    resolve(res)
                }).catch(
                    res => {
                        reject(res)
                    }
                )
            })
        }
    }
}
export default personInfo
